using Boo.Lang;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;

[Serializable]
public class crossbuy : MonoBehaviour
{
	[Serializable]
	[CompilerGenerated]
	internal sealed class _0024quit_0024293 : GenericGenerator<WaitForSeconds>
	{
		internal crossbuy _0024self__0024295;

		public _0024quit_0024293(crossbuy self_)
		{
			_0024self__0024295 = self_;
		}

		public override IEnumerator<WaitForSeconds> GetEnumerator()
		{
			return new _0024(_0024self__0024295);
		}
	}

	public Rigidbody parts;

	public AudioClip clip;

	public Color pressed;

	public Color unpressed;

	public GameObject bg;

	public Collider no;

	public Camera mainCamera;

	public void Update()
	{
		if (Input.GetMouseButtonUp(0))
		{
			st();
		}
		if (Input.GetMouseButtonDown(0))
		{
			RaycastHit hitInfo = default(RaycastHit);
			if (Physics.Raycast(mainCamera.ScreenPointToRay(UnityEngine.Input.mousePosition), out hitInfo, 100f) && hitInfo.collider.name == "No")
			{
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				no.GetComponent<Renderer>().material.color = pressed;
				no.GetComponent<Renderer>().material.SetColor("_SpecColor", pressed);
				parts.isKinematic = false;
				StartCoroutine(quit());
			}
		}
	}

	public IEnumerator quit()
	{
		return new _0024quit_0024293(this).GetEnumerator();
	}

	public void st()
	{
		no.GetComponent<Renderer>().material.color = unpressed;
		no.GetComponent<Renderer>().material.SetColor("_SpecColor", Color.white);
	}

	public void Main()
	{
	}
}
